package it.webrules.deploymanager.core;

public class OperationResult {

	public boolean success = false;
	public String desc = "";

	public OperationResult() {
		success = true;
	}

	public OperationResult(boolean success, String desc) {
		this.success = success;
		this.desc = desc;
	}

	public OperationResult(String desc) {
		this(true, desc);
	}

	public void success(String desc) {
		success = true;
		this.desc = desc;
	}

	public void fail(String desc) {
		success = false;
		this.desc = desc;
	}

	@Override
	public String toString() {
		if (success)
			return "Operation completed successfully.\n" + desc;
		return "Operation failed!\n" + desc;
	}
}
